The present invention relates to data entry system for an electronic calculator and more particularly to an algebraic operating system capable of responding to parentheses in an algebraic expression. When referring to a hierarchal mathematical command, I intend to refer to an inputted mathematic function which requires two operators, such as the functions: add, subtract, multiply, divide Y.sup.x, .sup.x .sqroot.Y and the like. Non-hierarchal mathematical commands then refer to an inputted mathematic function which requires only one operator, such as: log x, 1n x, X!, sine X, cosine X, tangent X and the like.
The data entry systems which have been used on electronic calculators known in the prior art may be separated into three classes. The first class corresponds to hierarchal data entry systems which are discussed hereafter. The second and third classes correspond to non-hierarchal data entry systems; the second class being algebraic, non-hierarchal calculators and the third class being non-algebraic, non-hierarchal calculators. The difference between these classes of calculators is best pointed out by example. Calculators of the third class utilize, for instance, data entry systems known as "reverse polish notation" in which both operators in an hierarchal expression must be entered before the hierarchal mathematical command is inputted into the electronic calculator. Thus, to multiply 3.times.6, first the three is keyed in, then the six is keyed in and finally the multiply command (X) is keyed in. Since the order in which the data and hierarchal mathematical commands are keyed in differs from the corresponding algebraic expression . . 3.times.6 . . this third class is referred to as non-hierarchal, non-algebraic data entry systems. Data entry systems of the second class are algebraic in nature but are similarly non-hierarchal. That is, the mathematic commands are performed in the order received, thus if 2+3.times.6 were keyed into an electronic calculator of the second class then the two would first be added to the three and the sum (five) would be multiplied by the six to obtain thirty. However, since the normal hierarchy associated with mathematic expressions requires the multiplication to be performed prior to the addition, the expression 2+3.times.6 should equal twenty and not thirty.
Electronic calculators of the first class are those calculators which generally follow the rules of algebraic hierarchy. Thus, in the aforementioned example, such an electronic calculator would not perform the 2+3 addition when the three is followed by a multiplication command, but would carry out the indicated multiplication before the addition.
Electronic calculators having a hierarchal algebraic data entry system are known in the prior art; however, these hierarchal algebraic data entry systems exhibit only minimal hierarchy. Exemplary of the electronic calculators exhibiting minimal algebraic hierarchy is the electronic calculator disclosed in U.S. Pat. No. 3,720,820 dated Mar. 13, 1973. This electronic calculator has three levels of hierarchy and therefore, can perform the expression 2+3.times.5.sup.3 in correct algebraic hierarchy, in as much as the 5 would be cubed before it is multiplied times three and the cubing operations and multiplying operations would be accomplished before the indicated addition operation. However, the electronic calculator disclosed in U.S. Pat. No. 3,720,820 is incapable of receiving an algebraic expression such as 2+3.times.5.sup.(2+1), there being no provision parentheses keys with the calculator disclosed in U.S. Pat. No. 3,720,820. It should be evident to a person acquainted with writing of algebraic expressions that the use of parentheses in algebraic expressions greatly expands the ability of one to write or express complicated algebraic formula.
It is therefore one object of this invention to equip an electronic calculator with an algebraic operating system capable of responding to parentheses in an algebraic expression according to the rules of algebraic hierarchy.
It is another object of this invention to increase the levels of complexity of algebraic expressions which a hand held or desk model calculator can accommodate.
The foregoing objects are achieved according to the present invention as now described. In a preferred embodiment invention, an algebraic operating system memory is interconnected with a modern electronic calculator system. The algebraic operating system memory is preferrably implemented as a stack memory, and has provision for storing data words, pending arithmetic operator codes and a parentheses level count associated with each data word. The algebraic operating system memory is arranged to store the most recently received hierarchal mathematical command as a pending arithmetic operator and to execute any previously stored pending arithmetic operator having the same or higher hierarchy than the just received hierarchal mathematical command, so long as both pending arithmetic operators are at the same parentheses level count. If the previously stored pending arithmetic operator is of a lower hierarchy level than the just received pending arithmetic operator, or if the parentheses level count increments the previously stored pending arithmetic operator is not executed but is rather bumped in the memory stack when the most recently received arithmetic operator and associated data are inserted into the algebraic operating system memory stack. A left handed parentheses increments the parentheses level count while a right handed parentheses decrements the parentheses level count. A right handed parentheses also causes all pending arithmetic operators at that parentheses level count to be executed in the order that they are read out of the algebraic operating system memory stack. An equals sign causes all pending arithmetic operators to be executed in the order that they are read out of the algebraic operating system memory stack regardless of parentheses count level.